package com.example.springbootstudy03jsp.service.Impl;

import com.example.springbootstudy03jsp.bean.User;
import com.example.springbootstudy03jsp.repository.UserDao;
import com.example.springbootstudy03jsp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public Collection<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public User findById(Integer id) {
        return userDao.findById(id);
    }

    @Override
    public void save(User user) {
        userDao.save(user);
    }

    @Override
    public void update(User user) {

        userDao.update(user);
    }

    @Override
    public void delect(Integer id) {
        userDao.delect(id);
    }
}
